package top.dancun.eascrawler.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.dancun.common.utils.R;
import top.dancun.eascrawler.http.CNKIHttp;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * @author dancun
 */
@RestController
public class CNKIController {
    @Autowired
    private CNKIHttp http;
    @RequestMapping("/searchdata")
    public R getCount(@RequestBody Map<String,String> map ) throws IOException {
//        Map<String,String> map = new HashMap<>();
//        map.put("from","清华大学");
        return R.ok().put("count",http.requestCount(map));
    }
}
